<template>
  <div class="film_list">
    <div class="title">最受好评电影</div>
    <MySwiper :preview="4" :height="150" :key="films.length">
      <div class="swiper-slide" v-for="item in films" :key="item.filmId">
        <img style="width:85px; height: 115px" :src="item.poster" />
        <div class="name">{{ item.name }}</div>
      </div>
    </MySwiper>
  </div>
</template>

<script>

import MySwiper from "../components/MySwiper";

export default {
  data() {
    return {
      films: [],
    };
  },
  components: {
    MySwiper,
  },
  async mounted() {
    let ret = await this.$api.getNowPlayList({ cityId: 110100});
    // console.log(ret)
    this.films = ret.data.films;
    // console.log(this.films);
  },
};
</script>
<style lang='scss' scoped>
.film_list {
  width: 100%;
  background: #f5f5f5;
  .title{
       font-size: 14px;
    color: #333;
        padding-top: 12px;
    padding-bottom: 12px;
  text-indent:10px;

  }
  .swiper-slide{
      margin-left: 10px;
      .name{
    
    font-size: 13px;
    font-weight:bold;
    color: #222;
    margin-bottom: 3px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
      }
  }
}
</style>
